<div>
    <div id="bind_phone-html">

        <div class="reg-box">
            <div class="titles fiex">
                <div class="black"><a href="javascript:window.history.go(-1);" ><svg class="g2" ><use xlink:href="#f_black"></use></svg></a></div>
                <div class="fiex1 f-40"><span data-l="1142"></span></div></div>
            <div class="bank80"></div>

            <div class="bank20"></div>
            <form id="bind_reg">
                <div class="login-new f-28 reg-new">				
                    <div class="line-ddd"> </div>

                    <div class="item cf fiex">
                        <div class="fiex1 name"><span data-l="1075"></span></div>
                        <div class="fiex2">
                            <div class="select1"><p>Malaysia+60</p>
                                <svg  style="width: 0.15rem; height: 0.15rem; margin-top: -0.075rem;"><use xlink:href="#f_select"></use></svg>
                                <input type="hidden" class="select-inp" name="prefix" value="60" data-values="2" />
                            </div>
                        </div>
                    </div>
                    <div class="item cf fiex">
                        <div class="fiex1 name"><span data-l="1077"></span></div>
                        <div class="fiex2 fiex">
                            <div class="fiex4"><input class="f-28 required" name="username" type="tel"  placeholder="" data-valid="isNonEmpty"  data-p="1070" data-e="1070" /></div>
                            <div class="fiex5 f-right"><a href="javascript:;"  class="bon-green f-24" id="scode" style="min-width: 6em; padding: 0.1rem;"><span data-l="1078"></span></a></div>
                        </div>					
                    </div>
                    <div class="item cf fiex">
                        <div class="fiex1 name"><span data-l="1079"></span></div>
                        <div class="fiex2"><input class="f-28 required" name="code" type="tel"  placeholder="" data-valid="isNonEmpty"  data-p="1080" data-e="1080" /></div>
                    </div>
                    <div class="bank20"></div>
                    <div class="line-ddd"> </div>
                    <div class="item cf fiex">
                        <div class="fiex1 name"><span data-l="1081"></span></div>
                        <div class="fiex2"><input class="f-28 required"  type="password" id="pwd"  placeholder="" data-valid="isNonEmpty"  data-p="1072" data-e="1072" /></div>
                    </div>
                    <div class="item cf fiex">
                        <div class="fiex1 name"><span data-l="1082"></span></div>
                        <div class="fiex2"><input class="f-28 required" name="password"  type="password"  placeholder="" data-valid="matchPwd" data-matchID="pwd" data-error=""  data-p="1083" data-e="1087" /></div>
                    </div>
                    <div class="errortip center pad-10 red"></div>
                    <div class="bank40"></div>
                    <div class="button mag-t-40 center">
                        <a href="javascript:;" class="bon-green f-30" id="submit-reg1" style="width: 60%;"><span data-l="1086"></span></a> </div>
           		
           			<div class="bank30"></div>
           			<div class="button mag-t-40 center">
                        <a href="#!bind_phone_old-html" class="bon-white f-24" ><span data-l="1143" style="padding: 0 1.2em;"></span></a> </div>
           
           
                    <div class="bank20"></div>
                    <input class="f-28" type="hidden"  name="language" />

                </div>
            </form>
        </div>

		<style>
			body .bon-green.null{ background: #ddd; border-color: #ddd; color: #333;}
		</style>

        <script>
            //当前页面禁止拖动
            $("input[name=language]").val(getCookie("language"))

            $(".select-inp").select({
                title: lange["1075"],
                items: reg_datas,
                onChange: function (d) {
                    console.log(this, d);
                    $(".select1 p").text(d.titles)
                    $(".select-inp").val(d.values)
                }
            });


            $(".select1").on("click", function () {
                $(".select-inp").select("open", function () {})
            })

            //发送验证码
            $("#scode").on("click", function () {
                var $th = $(this);
                if ($th.hasClass("null"))
                    return false;

                if ($("input[name=username]").val() == "") {
                    $.toast(lange["1070"], "text");
                    return false
                }

                $th.addClass("null")

                //验证手机号码有效性
                bef_ajax(jsonpath + "put_mobile_valid", {"prefix": $("input[name=prefix]").val(), "username": $("input[name=username]").val()}, function (e) {
                    if (e.status == 1) {
                        //如果成功发送验证码
                        bef_ajax(jsonpath + "send_reg_code", {"prefix": $("input[name=prefix]").val(), "username": $("input[name=username]").val()}, function (ee) {
                            if (ee.status == 1) {
                                //如果成功发送验证码
                                $.toast(lange["1089"], "text");
                                var s1 = 60,
                                        s2 = setInterval(function () {
                                            s1--;
                                            $th.find("span").text(s1 + "s");
                                            if (s1 == 0)
                                            {
                                                $th.find("span").text(lange["1078"]);
                                                $th.removeClass("null")
                                                clearInterval(s2);
                                            }
                                        }, 1000)
                            } else {
                            	$th.removeClass("null")
                                $.toast(ee.msg, "text");
                            }
                        })
                    } else {
                        //发送失败
                        $th.removeClass("null")
                        $.toast(e.msg, "text");
                    }

                })
                return false



            })

            //验证
            $('.reg-new').validate({
                onFocus: function () {
                    this.parent().addClass('active');
                    return false;
                },
                onBlur: function () {
                    var $parent = this.parent();
                    var _status = parseInt(this.attr('data-status'));
                    $parent.removeClass('active');
                    if (!_status) {
                        $parent.addClass('error');
                    }
                    return false;
                },
                onBlurpass: true, //blur检测
                selectID: $(".errortip")//指定弹出位置
            });

            //绑定新帐号登录
//          var sync_login_info = getCookie("sync_login_info")?JSON.parse(getCookie("sync_login_info")):{};
//          $("input[name='nickname']").val(sync_login_info.nickname);
            $("#submit-reg1").on("click", function () {
                if ($(".reg-new").validate('submitValidate')) {
                    global_ajax(jsonpath + "build_mobile", $("#bind_reg").serialize(), function (e) {                    	
                        if (e.status == 1) {
                           
                            
                            if(isAPP){//改变用户状态
                        		$.each(e.result, function (v, i) {
                        			plus.storage.setItem(v, i);
	                            })
                        	}else{
                        		$.each(e.result, function (v, i) {
                        			 setCookie(v, i, 365);
	                            })
                        	}
                            
                            localStorage.removeItem("point")
                            Q.go("bind_down-html")
                        } else {
                            $.toast(e.msg, "text");
                        }
                    });
                }
            })

    
        </script>


    </div>

</div>